var randomArray = function () {
	arr = [];
	for (var i = 0; i < 8; i++) {
		arr.push(Math.random()*2 -1);
	}
    console.log(arr);
	return arr;
};

$( document ).ready(function() {


var options = {barValueSpacing : 15, scaleBeginAtZero : false};
var data = {
    labels: ["Postimees", "Delfi", "EPL", "Pealinn", "Äripäev", "Õhtuleht", "Ekspress", "ERR"],
    datasets: [
        {
            label: "KESK",
            fillColor: "rgba(0, 117, 87, 1)",
            data: randomArray()
        },
        {
            label: "REF",
            fillColor: "rgba(255, 233, 0, 1)",
            data: randomArray()
        },
        {
            label: "SDE",
            fillColor: "rgba(193, 34, 43, 1)",
            data: randomArray()
        },
        {
            label: "IRL",
            fillColor: "rgba(0, 173, 239, 1)",
            data: randomArray()
        },
        {
            label: "ROH",
            fillColor: "rgba(123, 198, 80, 1)",
            data: randomArray()
        }
    ]
};

    var ctx = document.getElementById("myChart").getContext("2d");
    var myBarChart = new Chart(ctx).Bar(data, options);

});